package com.hs;

/**
 * @Author: hs
 * @Description:
 * @Date: Create in 16:34 2019/4/20
 */
public class InterruptedTest2 extends Thread {
    public static void main(String args[]) throws Exception {
        InterruptedTest2 thread = new InterruptedTest2();
        thread.start();
    }

    @Override
    public void run() {
        while (!Thread.currentThread().isInterrupted()) {
            try {
                Thread.currentThread().interrupt();
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                System.out.println(this.isInterrupted());
                Thread.currentThread().interrupt();
            }
        }
    }
}